import time
import configparser
import pandas as pd
import math
import json
from datetime import datetime

from src.blf_parser import BlfParser
from src.utils import BASE_DICT,LINE_ATTR_DICT,OBJ_ATTR_DICT
from src.tcp_communication import TcpServer


"""
ICDC数据播放器:
播放基于台架采集到的融合CANFD报文,构造座舱3d渲染所需数据结构,通过TCP发送至座舱
"""

class IcdcDataPlayer():
    def __init__(self,blf_file,dbc_path,config_path):
        self.blf_parser = BlfParser(dbc_path,blf_file)
        self.__config_file_path = config_path
        self.__icdc_ip = None
        self.__icdc_port = None
        self.message_amount = 0
        self.msg_cycle_time = 0
        self.obj_num = 0
        self.line_num = 0
        self.fusion_msg_confirm_index = None
        self.fusion_msg_confirm__series = None
        self.fusion_msg_flag = False
        self.base_dict = None
        self.__config_work()
        self.last_time = 0
        self.current_time = 0
        self.tcp_server = TcpServer(self.__icdc_ip,self.__icdc_port)
        
    def __update_all_dict(self):
        """
        clean up work
        """
        for i in range(self.obj_num):
            exec(f"self.obj{i}_attr_dict = {OBJ_ATTR_DICT.copy()}")
        for i in range(self.line_num):
            exec(f"self.line{i}_attr_dict = {LINE_ATTR_DICT.copy()}")
        self.fusion_msg_confirm__series.values[:] = 0
        
        self.base_dict = {
            "object_list": {
                "obj_num": 0,
                "objects": []
                },
            "lane_lines": {
                "line_num": 4, 
                "lane_change":[0, 0], 
                "direction":0,
                "lines": []
                }   
            }
        
    def __config_work(self):
        """
        读取配置文件，并对相关属性赋值
        """
        config = configparser.ConfigParser()
        config.read(self.__config_file_path)
        self.message_amount = eval(config["FusionMsgInfo"]["msgNum"])
        self.msg_cycle_time = eval(config["FusionMsgInfo"]["CycleTime"])
        self.obj_num = eval(config["FusionMsgInfo"]["obj_num"])
        self.line_num = eval(config["FusionMsgInfo"]["line_num"])
        self.__icdc_ip = config["ICDCInfo"]["IP"]
        self.__icdc_port = eval(config["ICDCInfo"]["Port"])
         # 创建消息确认索引列表[0,1,2,...,message_amount-1]
        self.fusion_msg_confirm_index = [str(i) for i in range(self.message_amount)]
        # 创建消息确认Series,初始值全为0
        self.fusion_msg_confirm__series = pd.Series([0 for i in range(len(self.fusion_msg_confirm_index))],
                                               index=self.fusion_msg_confirm_index)
        
        self.__update_all_dict()
        
    def __line_measureing_state_transition(self,state):
        """
        车道线检测状态mapping
        TODO: 跟相关人员确认下,在以下状态中，预测属于识别还是未识别，当前按照观测和预测都算是识别，其他则为未识别
            0=Unknown
            1=New
            2=Measured_Parallel
            3=Predicted_Parallel
            4=Measured_Unparallel
            5=Predicted_Unparallel
            6=Not valid
        """
        temp_state = 0
        if state in [1,2,3,4,5]:
            temp_state = 1
        return temp_state
    
    def __line_type_transition(self,line_type):
        """
        弃用，json类型已经和Fusion类型匹配
        车道线类型转换
            Fusion输出类型
                0=Unknown
                1=Solid
                2=Road Edge
                3=Dashed
                4=Double Lane(Left Dashed, Right Solid)
                5=Double Lane(Left Solid, Right Dashed)
                6=Double Lane(Double Dashed)
                7=Double Lane(Double Solid)
                8=Line Ramp(Solid)
                9=Line Ramp(Dashed)
                10=ShadedArea
                11=DecelerationSolidLine
                12=DecelerationDashedLine
                13=LaneVirtualMarking
                15=Invalid
            json定义类型
                0 单实线
                1 单虚线
                2 双实线
                3 双虚线
                4 虚实结合线
        车道线融合模块输出的道线类型与json定义的车道线类型是无法完全匹配的，如当出现unknown、
        road edge、ShadedArea、Invalid等类型时，无法与json定义的这几种类型进行映射
        """
        temp_type = 0
        if line_type in [3,9,12]:
            temp_type = 1
        elif line_type == 7:
            temp_type == 2
        elif line_type == 6:
            temp_type = 3
        elif line_type in [4,5]:
            temp_type = 4
        return temp_type
    
    def __line_color_transition(self,color):
        """
        车道线颜色mapping
            融合定义的颜色类型
                0=Unknown
                1=White
                2=Yellow_Orange_Red
                3=Blue_Green
                
            json定义的颜色类型
                0 UNKNOWN 未知
                1 WHITE 白色
                2 YELLOW 黄色
                3 BLUE 蓝色
                4 ORANGE 橙色
                5 RED 红色
        中国只有白色和黄色两种道线颜色，融合输出的车道线颜色能够直接对json中的colour进行赋值
        """
        pass
        
        
    def data_replay(self):
        """
        数据播放:数据收集全了以后通过TCP发送至座舱
        """
        self.last_time = time.time()
        # 遍历所有的BLF消息列表
        for msg in self.blf_parser.blf_message_list:
            # 检查是否所有消息都已处理完成(fusion_msg_confirm__series中所有值之和等于消息总数)
            if self.fusion_msg_confirm__series.sum() == self.message_amount:
                # 将所有目标物属性字典添加到base_dict的object_list中
                self.base_dict["object_list"]["objects"] = [self.obj0_attr_dict,self.obj1_attr_dict,self.obj2_attr_dict,self.obj3_attr_dict,
                                                            self.obj4_attr_dict,self.obj5_attr_dict,self.obj6_attr_dict,self.obj7_attr_dict,
                                                            self.obj8_attr_dict,self.obj9_attr_dict,self.obj10_attr_dict,self.obj11_attr_dict,
                                                            self.obj12_attr_dict,self.obj13_attr_dict,self.obj14_attr_dict,self.obj15_attr_dict,
                                                            self.obj16_attr_dict,self.obj17_attr_dict,self.obj18_attr_dict,self.obj19_attr_dict]
                
                # 将所有车道线属性字典添加到base_dict的lane_lines中
                self.base_dict["lane_lines"]["lines"] = [self.line0_attr_dict,self.line1_attr_dict,self.line2_attr_dict,self.line3_attr_dict]
                # 将base_dict转换为JSON字符串并编码为UTF-8格式
                message_json = json.dumps(self.base_dict).encode("utf-8")
                # 重置所有字典为初始状态，准备下一轮数据收集
                self.__update_all_dict()
                # 计算数据处理耗时
                current_time = time.time()
                cost_time = current_time - self.last_time
                # 计算需要等待的时间以满足消息周期要求
                temp_sleep_time = self.msg_cycle_time - cost_time
                # print(f"after {cost_time} seconds,data collection completed,still needs {temp_sleep_time} to wait")                
                if temp_sleep_time >= 0:
                    time.sleep(temp_sleep_time)
               
               # 通过TCP发送JSON消息
                self.tcp_server.send_message(message_json)
                # print(json.dumps(self.base_dict, indent=4))
                self.last_time = time.time()
                 
            # 消息ID 0x500 - 处理对象数量
            if msg.arbitration_id == 0x500:
                current_obj_num = self.blf_parser.signal_parser(msg,"SEN_Obj_00_Quantity")
                self.base_dict["object_list"]["obj_num"] = current_obj_num
                self.fusion_msg_confirm__series["0"] = 1 
                
            # 左侧车道线
            if msg.arbitration_id == 0x501:
                # 解析整条CAN消息
                temp_msg = self.blf_parser.msg_parser(msg)
                
                SEN_LAN_Left_Confidence = temp_msg["SEN_LAN_Left_Confidence"]# 车道线置信度
                SEN_LAN_Left_Measuring_State = self.__line_measureing_state_transition(temp_msg["SEN_LAN_Left_Measuring_State"])# 车道线检测状态(通过状态转换函数处理)
                SEN_LAN_Left_Type = temp_msg["SEN_LAN_Left_Type"]# 车道线类型(实线/虚线等)
                SEN_LAN_Left_Color = temp_msg["SEN_LAN_Left_Color"]# 车道线颜色
                SEN_LAN_Left_RangeStart = temp_msg["SEN_LAN_Left_RangeStart"]# 起点位置
                SEN_LAN_Left_RangeEnd = temp_msg["SEN_LAN_Left_RangeEnd"]# 终点位置
                SEN_LAN_Left_Crossing = temp_msg["SEN_LAN_Left_Crossing"]# 是否有交叉
                # 将解析的属性存入左侧车道线字典(line0_attr_dict)
                self.line0_attr_dict["id"] = 2
                self.line0_attr_dict["identification"] = SEN_LAN_Left_Measuring_State
                self.line0_attr_dict["type"] = SEN_LAN_Left_Type
                self.line0_attr_dict["prob_of_line"] = SEN_LAN_Left_Confidence
                self.line0_attr_dict["Crossing"] = SEN_LAN_Left_Crossing
                self.line0_attr_dict["colour"] = SEN_LAN_Left_Color 
                self.line0_attr_dict["point_list"][0] = SEN_LAN_Left_RangeStart
                self.line0_attr_dict["point_list"][1] = SEN_LAN_Left_RangeEnd
                self.fusion_msg_confirm__series["1"] = 1
            
            # 检查是否为左侧车道线曲线参数消息(ID: 0x502)
            if msg.arbitration_id == 0x502:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_LAN_Left_C0 = temp_msg["SEN_LAN_Left_C0"]
                SEN_LAN_Left_C1 = temp_msg["SEN_LAN_Left_C1"]
                SEN_LAN_Left_C2 = temp_msg["SEN_LAN_Left_C2"]
                SEN_LAN_Left_C3 = temp_msg["SEN_LAN_Left_C3"]
                self.line0_attr_dict["point_list"][2] = SEN_LAN_Left_C0
                self.line0_attr_dict["point_list"][3] = SEN_LAN_Left_C1
                self.line0_attr_dict["point_list"][4] = SEN_LAN_Left_C2
                self.line0_attr_dict["point_list"][5] = SEN_LAN_Left_C3
                self.fusion_msg_confirm__series["2"] = 1
            
            # 右侧车道线    
            if msg.arbitration_id == 0x503:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_LAN_Right_Confidence = temp_msg["SEN_LAN_Right_Confidence"]
                SEN_LAN_Right_Measuring_State = self.__line_measureing_state_transition(temp_msg["SEN_LAN_Right_Measuring_State"])
                SEN_LAN_Right_Type = temp_msg["SEN_LAN_Right_Type"]
                SEN_LAN_Right_Color = temp_msg["SEN_LAN_Right_Color"]
                SEN_LAN_Right_RangeStart = temp_msg["SEN_LAN_Right_RangeStart"]
                SEN_LAN_Right_RangeEnd = temp_msg["SEN_LAN_Right_RangeEnd"]
                SEN_LAN_Right_Crossing = temp_msg["SEN_LAN_Right_Crossing"]
                self.line1_attr_dict["id"] = 3
                self.line1_attr_dict["identification"] = SEN_LAN_Right_Measuring_State
                self.line1_attr_dict["type"] = SEN_LAN_Right_Type
                self.line1_attr_dict["prob_of_line"] = SEN_LAN_Right_Confidence
                self.line1_attr_dict["Crossing"] = SEN_LAN_Right_Crossing
                self.line1_attr_dict["colour"] = SEN_LAN_Right_Color 
                self.line1_attr_dict["point_list"][0] = SEN_LAN_Right_RangeStart
                self.line1_attr_dict["point_list"][1] = SEN_LAN_Right_RangeEnd
                self.fusion_msg_confirm__series["3"] = 1
            
            if msg.arbitration_id == 0x504:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_LAN_Right_C0 = temp_msg["SEN_LAN_Right_C0"]
                SEN_LAN_Right_C1 = temp_msg["SEN_LAN_Right_C1"]
                SEN_LAN_Right_C2 = temp_msg["SEN_LAN_Right_C2"]
                SEN_LAN_Right_C3 = temp_msg["SEN_LAN_Right_C3"]
                self.line1_attr_dict["point_list"][2] = SEN_LAN_Right_C0
                self.line1_attr_dict["point_list"][3] = SEN_LAN_Right_C1
                self.line1_attr_dict["point_list"][4] = SEN_LAN_Right_C2
                self.line1_attr_dict["point_list"][5] = SEN_LAN_Right_C3
                self.fusion_msg_confirm__series["4"] = 1
                
            # 左左车道线
            if msg.arbitration_id == 0x505:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_LAN_Next_Left_Confidence = temp_msg["SEN_LAN_Next_Left_Confidence"]
                SEN_LAN_Next_Left_Measuring_State = self.__line_measureing_state_transition(temp_msg["SEN_LAN_Next_Left_State"])
                SEN_LAN_Next_Left_Type = temp_msg["SEN_LAN_Next_Left_Type"]
                SEN_LAN_Next_Left_Color = temp_msg["SEN_LAN_Next_Left_Color"]
                SEN_LAN_Next_Left_RangeStart = temp_msg["SEN_LAN_Next_Left_RangeStart"]
                SEN_LAN_Next_Left_RangeEnd = temp_msg["SEN_LAN_Next_Left_RangeEnd"]
                SEN_LAN_Next_Left_Crossing = temp_msg["SEN_LAN_Next_Left_Crossing"]
                self.line2_attr_dict["id"] = 1
                self.line2_attr_dict["identification"] = SEN_LAN_Next_Left_Measuring_State
                self.line2_attr_dict["type"] = SEN_LAN_Next_Left_Type
                self.line2_attr_dict["prob_of_line"] = SEN_LAN_Next_Left_Confidence
                self.line2_attr_dict["Crossing"] = SEN_LAN_Next_Left_Crossing
                self.line2_attr_dict["colour"] = SEN_LAN_Next_Left_Color 
                self.line2_attr_dict["point_list"][0] = SEN_LAN_Next_Left_RangeStart
                self.line2_attr_dict["point_list"][1] = SEN_LAN_Next_Left_RangeEnd
                self.fusion_msg_confirm__series["5"] = 1
            
            if msg.arbitration_id == 0x506:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_LAN_Next_Left_C0 = temp_msg["SEN_LAN_Next_Left_C0"]
                SEN_LAN_Next_Left_C1 = temp_msg["SEN_LAN_Next_Left_C1"]
                SEN_LAN_Next_Left_C2 = temp_msg["SEN_LAN_Next_Left_C2"]
                SEN_LAN_Next_Left_C3 = temp_msg["SEN_LAN_Next_Left_C3"]
                self.line2_attr_dict["point_list"][2] = SEN_LAN_Next_Left_C0
                self.line2_attr_dict["point_list"][3] = SEN_LAN_Next_Left_C1
                self.line2_attr_dict["point_list"][4] = SEN_LAN_Next_Left_C2
                self.line2_attr_dict["point_list"][5] = SEN_LAN_Next_Left_C3
                self.fusion_msg_confirm__series["6"] = 1
                
            # 右右车道线
            if msg.arbitration_id == 0x507:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_LAN_Next_Right_Confidence = temp_msg["SEN_LAN_Next_Right_Confidence"]
                SEN_LAN_Next_Right_Measuring_State = self.__line_measureing_state_transition(temp_msg["SEN_LAN_Next_Right_State"])
                SEN_LAN_Next_Right_Type = temp_msg["SEN_LAN_Next_Right_Type"]
                SEN_LAN_Next_Right_Color = temp_msg["SEN_LAN_Next_Right_Color"]
                SEN_LAN_Next_Right_RangeStart = temp_msg["SEN_LAN_Next_Right_RangeStart"]
                SEN_LAN_Next_Right_RangeEnd = temp_msg["SEN_LAN_Next_Right_RangeEnd"]
                SEN_LAN_Next_Right_Crossing = temp_msg["SEN_LAN_Next_Right_Crossing"]
                self.line3_attr_dict["id"] = 4
                self.line3_attr_dict["identification"] = SEN_LAN_Next_Right_Measuring_State
                self.line3_attr_dict["type"] = SEN_LAN_Next_Right_Type
                self.line3_attr_dict["prob_of_line"] = SEN_LAN_Next_Right_Confidence
                self.line3_attr_dict["Crossing"] = SEN_LAN_Next_Right_Crossing
                self.line3_attr_dict["colour"] = SEN_LAN_Next_Right_Color 
                self.line3_attr_dict["point_list"][0] = SEN_LAN_Next_Right_RangeStart
                self.line3_attr_dict["point_list"][1] = SEN_LAN_Next_Right_RangeEnd
                self.fusion_msg_confirm__series["7"] = 1
            
            if msg.arbitration_id == 0x508:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_LAN_Next_Right_C0 = temp_msg["SEN_LAN_Next_Right_C0"]
                SEN_LAN_Next_Right_C1 = temp_msg["SEN_LAN_Next_Right_C1"]
                SEN_LAN_Next_Right_C2 = temp_msg["SEN_LAN_Next_Right_C2"]
                SEN_LAN_Next_Right_C3 = temp_msg["SEN_LAN_Next_Right_C3"]
                self.line3_attr_dict["point_list"][2] = SEN_LAN_Next_Right_C0
                self.line3_attr_dict["point_list"][3] = SEN_LAN_Next_Right_C1
                self.line3_attr_dict["point_list"][4] = SEN_LAN_Next_Right_C2
                self.line3_attr_dict["point_list"][5] = SEN_LAN_Next_Right_C3
                self.fusion_msg_confirm__series["8"] = 1
                
            # 目标物1 A
            if msg.arbitration_id == 0x509:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_01_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_01_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_01_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_01_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_01_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_01_Acceleration_X"] # new
                self.obj0_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj0_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj0_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj0_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj0_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj0_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj0_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["9"] = 1
                    
            # 目标物1 B
            if msg.arbitration_id == 0x50a:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_01_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_01_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_01_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_01_Confidence"])
                self.obj0_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj0_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj0_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj0_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj0_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["10"] = 1
                
            # 目标物1 C
            if msg.arbitration_id == 0x50b:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_01_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_01_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_01_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_01_ID_Camera"]
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_01_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_01_Brake_Lights_C"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                self.obj0_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj0_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj0_attr_dict["obj_class"] = obj_type
                self.obj0_attr_dict["dynamic_prop"] = motion_status
                self.obj0_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["11"] = 1
                    
            # 目标物2 A
            if msg.arbitration_id == 0x50c:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_02_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_02_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_02_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_02_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_02_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_02_Acceleration_X"] # new
                self.obj1_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj1_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj1_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj1_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj1_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj1_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj1_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["12"] = 1
            
            # 目标物2 B
            if msg.arbitration_id == 0x50d:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_02_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_02_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_02_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_02_Confidence"])
                self.obj1_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj1_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj1_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj1_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj1_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["13"] = 1
                
            # 目标物2 C
            if msg.arbitration_id == 0x50e:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_02_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_02_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_02_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_02_ID_Camera"]
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_02_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_02_Brake_Lights_C"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                self.obj1_attr_dict["obj_class"] = obj_type
                self.obj1_attr_dict["dynamic_prop"] = motion_status
                self.obj1_attr_dict["id"] = SEN_Obj_ID_Camera
                self.obj1_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj1_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.fusion_msg_confirm__series["14"] = 1
            
            # 目标物3 A
            if msg.arbitration_id == 0x50f:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_03_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_03_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_03_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_03_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_03_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_03_Acceleration_X"] # new
                self.obj2_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj2_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj2_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj2_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj2_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj2_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj2_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["15"] = 1
            
            # 目标物3 B
            if msg.arbitration_id == 0x510:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_03_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_03_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_03_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_03_Confidence"])
                self.obj2_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj2_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj2_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj2_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj2_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["16"] = 1
                
            # 目标物3 C
            if msg.arbitration_id == 0x511:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_03_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_03_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_03_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_03_ID_Camera"]
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_03_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_03_Brake_Lights_C"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                self.obj2_attr_dict["obj_class"] = obj_type
                self.obj2_attr_dict["dynamic_prop"] = motion_status
                self.obj2_attr_dict["id"] = SEN_Obj_ID_Camera
                self.obj2_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj2_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.fusion_msg_confirm__series["17"] = 1
            
            # 目标物4 A
            if msg.arbitration_id == 0x512:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_04_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_04_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_04_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_04_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_04_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_04_Acceleration_X"] # new
                self.obj3_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj3_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj3_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj3_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj3_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj3_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj3_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["18"] = 1
            
            # 目标物4 B
            if msg.arbitration_id == 0x513:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_04_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_04_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_04_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_04_Confidence"])
                self.obj3_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj3_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj3_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj3_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj3_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["19"] = 1
                
            # 目标物4 C
            if msg.arbitration_id == 0x514:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_04_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_04_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_04_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_04_ID_Camera"]
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_04_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_04_Brake_Lights_C"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                self.obj3_attr_dict["obj_class"] = obj_type
                self.obj3_attr_dict["dynamic_prop"] = motion_status
                self.obj3_attr_dict["id"] = SEN_Obj_ID_Camera
                self.obj3_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj3_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.fusion_msg_confirm__series["20"] = 1

            # 目标物5 A
            if msg.arbitration_id == 0x515:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_05_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_05_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_05_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_05_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_05_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_05_Acceleration_X"] # new
                self.obj4_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj4_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj4_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj4_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj4_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj4_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj4_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["21"] = 1
                
            # 目标物5 B
            if msg.arbitration_id == 0x516:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_05_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_05_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_05_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_05_Confidence"])
                self.obj4_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj4_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj4_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj4_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj4_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["22"] = 1
                
            # 目标物5 C
            if msg.arbitration_id == 0x517:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_05_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_05_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_05_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_05_ID_Camera"]
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_05_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_05_Brake_Lights_C"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                self.obj4_attr_dict["obj_class"] = obj_type
                self.obj4_attr_dict["dynamic_prop"] = motion_status
                self.obj4_attr_dict["id"] = SEN_Obj_ID_Camera
                self.obj4_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj4_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.fusion_msg_confirm__series["23"] = 1
            
            # 目标物6 A
            if msg.arbitration_id == 0x518:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_06_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_06_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_06_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_06_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_06_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_06_Acceleration_X"] # new
                self.obj5_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj5_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj5_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj5_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj5_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj5_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj5_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["24"] = 1
            
            # 目标物6 B
            if msg.arbitration_id == 0x519:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_06_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_06_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_06_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_06_Confidence"])
                self.obj5_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj5_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj5_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj5_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj5_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["25"] = 1
                
            # 目标物6 C
            if msg.arbitration_id == 0x51a:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_06_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_06_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_06_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_06_ID_Camera"]
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_06_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_06_Brake_Lights_C"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                self.obj5_attr_dict["obj_class"] = obj_type
                self.obj5_attr_dict["dynamic_prop"] = motion_status
                self.obj5_attr_dict["id"] = SEN_Obj_ID_Camera
                self.obj5_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj5_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.fusion_msg_confirm__series["26"] = 1
                    
            # 目标物7 A
            if msg.arbitration_id == 0x51b:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_07_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_07_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_07_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_07_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_07_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_07_Acceleration_X"] # new
                self.obj6_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj6_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj6_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj6_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj6_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj6_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj6_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["27"] = 1
            
            # 目标物7 B
            if msg.arbitration_id == 0x51c:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_07_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_07_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_07_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_07_Confidence"])
                self.obj6_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj6_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj6_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj6_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj6_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["28"] = 1
    
            # 目标物7 C
            if msg.arbitration_id == 0x51d:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_07_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_07_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_07_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_07_ID_Camera"]
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_07_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_07_Brake_Lights_C"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                self.obj6_attr_dict["obj_class"] = obj_type
                self.obj6_attr_dict["dynamic_prop"] = motion_status
                self.obj6_attr_dict["id"] = SEN_Obj_ID_Camera
                self.obj0_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj0_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.fusion_msg_confirm__series["29"] = 1
                    
            # 目标物8 A
            if msg.arbitration_id == 0x51e:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_08_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_08_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_08_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_08_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_08_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_08_Acceleration_X"] # new
                self.obj7_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj7_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj7_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj7_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj7_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj7_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj7_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["30"] = 1
            
            # 目标物8 B
            if msg.arbitration_id == 0x51f:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_08_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_08_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_08_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_08_Confidence"])
                self.obj7_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj7_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj7_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj7_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj7_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["31"] = 1
                
            # 目标物8 C
            if msg.arbitration_id == 0x520:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_08_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_08_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_08_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_08_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_08_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_08_Brake_Lights_C"]
                self.obj7_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj7_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj7_attr_dict["obj_class"] = obj_type
                self.obj7_attr_dict["dynamic_prop"] = motion_status
                self.obj7_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["32"] = 1
                    
            # 目标物9 A
            if msg.arbitration_id == 0x521:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_09_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_09_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_09_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_09_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_09_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_09_Acceleration_X"] # new
                self.obj8_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj8_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj8_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj8_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj8_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj8_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj8_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["33"] = 1
            
            # 目标物9 B
            if msg.arbitration_id == 0x522:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_09_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_09_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_09_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_09_Confidence"])
                self.obj8_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj8_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj8_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj8_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj8_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["34"] = 1
                
            # 目标物9 C
            if msg.arbitration_id == 0x523:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_09_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_09_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_09_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_09_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_09_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_09_Brake_Lights_C"]
                self.obj8_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj8_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj8_attr_dict["obj_class"] = obj_type
                self.obj8_attr_dict["dynamic_prop"] = motion_status
                self.obj8_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["35"] = 1
                    
            # 目标物10 A
            if msg.arbitration_id == 0x524:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_10_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_10_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_10_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_10_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_10_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_10_Acceleration_X"] # new
                self.obj9_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj9_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj9_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj9_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj9_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj9_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj9_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["36"] = 1
            
            # 目标物10 B
            if msg.arbitration_id == 0x525:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_10_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_10_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_10_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_10_Confidence"])
                self.obj9_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj9_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj9_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj9_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj9_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["37"] = 1
                
            # 目标物10 C
            if msg.arbitration_id == 0x526:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_10_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_10_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_10_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_10_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_10_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_10_Brake_Lights_C"]
                self.obj9_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj9_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj9_attr_dict["obj_class"] = obj_type
                self.obj9_attr_dict["dynamic_prop"] = motion_status
                self.obj9_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["38"] = 1
                
            # 目标物11 A
            if msg.arbitration_id == 0x527:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_11_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_11_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_11_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_11_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_11_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_11_Acceleration_X"] # new
                self.obj10_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj10_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj10_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj10_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj10_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj10_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj10_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["39"] = 1
            
            # 目标物11 B
            if msg.arbitration_id == 0x528:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_11_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_11_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_11_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_11_Confidence"])
                self.obj10_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj10_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj10_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj10_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj10_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["40"] = 1
                
            # 目标物11 C
            if msg.arbitration_id == 0x529:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_11_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_11_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_11_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_11_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_11_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_11_Brake_Lights_C"]
                self.obj10_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj10_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj10_attr_dict["obj_class"] = obj_type
                self.obj10_attr_dict["dynamic_prop"] = motion_status
                self.obj10_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["41"] = 1
            
            # 目标物12 A
            if msg.arbitration_id == 0x52a:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_12_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_12_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_12_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_12_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_12_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_12_Acceleration_X"] # new
                self.obj11_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj11_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj11_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj11_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj11_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj11_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj11_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["42"] = 1
            
            # 目标物12 B
            if msg.arbitration_id == 0x52b:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_12_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_12_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_12_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_12_Confidence"])
                self.obj11_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj11_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj11_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj11_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj11_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["43"] = 1
                
            # 目标物12 C
            if msg.arbitration_id == 0x52c:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_12_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_12_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_12_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_12_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_12_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_12_Brake_Lights_C"]
                self.obj11_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj11_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj11_attr_dict["obj_class"] = obj_type
                self.obj11_attr_dict["dynamic_prop"] = motion_status
                self.obj11_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["44"] = 1
                    
            # 目标物13 A
            if msg.arbitration_id == 0x52d:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_13_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_13_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_13_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_13_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_13_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_13_Acceleration_X"] # new
                self.obj12_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj12_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj12_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj12_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj12_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj12_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj12_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["45"] = 1
            
            # 目标物13 B
            if msg.arbitration_id == 0x52e:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_13_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_13_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_13_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_13_Confidence"])
                self.obj12_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj12_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj12_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj12_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj12_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["46"] = 1
                
            # 目标物13 C
            if msg.arbitration_id == 0x52f:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_13_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_13_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_13_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_13_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_13_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_13_Brake_Lights_C"]
                self.obj12_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj12_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj12_attr_dict["obj_class"] = obj_type
                self.obj12_attr_dict["dynamic_prop"] = motion_status
                self.obj12_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["47"] = 1
                    
            # 目标物14 A
            if msg.arbitration_id == 0x530:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_14_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_14_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_14_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_14_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_14_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_14_Acceleration_X"] # new
                self.obj13_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj13_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj13_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj13_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj13_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj13_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj13_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["48"] = 1
            
            # 目标物14 B
            if msg.arbitration_id == 0x531:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_14_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_14_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_14_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_14_Confidence"])
                self.obj13_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj13_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj13_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj13_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj13_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["49"] = 1
                
            # 目标物14 C
            if msg.arbitration_id == 0x532:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_14_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_14_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_14_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_14_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_14_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_14_Brake_Lights_C"]
                self.obj13_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj13_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj13_attr_dict["obj_class"] = obj_type
                self.obj13_attr_dict["dynamic_prop"] = motion_status
                self.obj13_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["50"] = 1
            
            # 目标物15 A
            if msg.arbitration_id == 0x533:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_15_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_15_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_15_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_15_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_15_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_15_Acceleration_X"] # new
                self.obj14_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj14_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj14_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj14_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj14_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj14_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj14_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["51"] = 1
            
            # 目标物15 B
            if msg.arbitration_id == 0x534:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_15_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_15_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_15_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_15_Confidence"])
                self.obj14_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj14_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj14_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj14_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj14_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["52"] = 1
                
            # 目标物15 C
            if msg.arbitration_id == 0x535:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_15_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_15_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_15_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_15_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_15_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_15_Brake_Lights_C"]
                self.obj14_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj14_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj14_attr_dict["obj_class"] = obj_type
                self.obj14_attr_dict["dynamic_prop"] = motion_status
                self.obj14_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["53"] = 1
            
            # 目标物16 A
            if msg.arbitration_id == 0x536:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_16_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_16_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_16_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_16_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_16_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_16_Acceleration_X"] # new
                self.obj15_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj15_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj15_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj15_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj15_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj15_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj15_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["54"] = 1
            
            # 目标物16 B
            if msg.arbitration_id == 0x537:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_16_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_16_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_16_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_16_Confidence"])
                self.obj15_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj15_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj15_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj15_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj15_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["55"] = 1
                
            # 目标物16 C
            if msg.arbitration_id == 0x538:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_16_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_16_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_16_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_16_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_16_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_16_Brake_Lights_C"]
                self.obj15_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj15_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj15_attr_dict["obj_class"] = obj_type
                self.obj15_attr_dict["dynamic_prop"] = motion_status
                self.obj15_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["56"] = 1
                    
            # 目标物17 A
            if msg.arbitration_id == 0x539:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_17_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_17_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_17_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_17_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_17_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_17_Acceleration_X"] # new
                self.obj16_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj16_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj16_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj16_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj16_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj16_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj16_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["57"] = 1
            
            # 目标物17 B
            if msg.arbitration_id == 0x53a:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_17_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_17_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_17_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_17_Confidence"])
                self.obj16_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj16_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj16_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj16_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj16_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["58"] = 1
                
            # 目标物17 C
            if msg.arbitration_id == 0x53b:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_17_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_17_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_17_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_17_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_17_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_17_Brake_Lights_C"]
                self.obj16_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj16_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj16_attr_dict["obj_class"] = obj_type
                self.obj16_attr_dict["dynamic_prop"] = motion_status
                self.obj16_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["59"] = 1
                    
            # 目标物18 A
            if msg.arbitration_id == 0x53c:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_18_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_18_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_18_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_18_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_18_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_18_Acceleration_X"] # new
                self.obj17_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj17_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj17_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj17_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj17_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj17_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj17_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["60"] = 1
            
            # 目标物18 B
            if msg.arbitration_id == 0x53d:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_18_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_18_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_18_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_18_Confidence"])
                self.obj17_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj17_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj17_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj17_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj17_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["61"] = 1
                
            # 目标物18 C
            if msg.arbitration_id == 0x53e:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_18_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_18_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_18_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_18_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                EN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_18_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_18_Brake_Lights_C"]
                self.obj17_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj17_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj17_attr_dict["obj_class"] = obj_type
                self.obj17_attr_dict["dynamic_prop"] = motion_status
                self.obj17_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["62"] = 1
                
            # 目标物19 A
            if msg.arbitration_id == 0x53f:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_19_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_19_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_19_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_19_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_19_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_19_Acceleration_X"] # new
                self.obj18_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj18_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj18_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj18_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj18_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj18_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj18_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["63"] = 1
            
            # 目标物19 B
            if msg.arbitration_id == 0x540:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_19_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_19_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_19_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_19_Confidence"])
                self.obj18_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj18_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj18_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj18_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj18_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["64"] = 1
        
            # 目标物19 C
            if msg.arbitration_id == 0x541:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_19_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_19_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_19_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_19_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_19_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_19_Brake_Lights_C"]
                self.obj18_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj18_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj18_attr_dict["obj_class"] = obj_type
                self.obj18_attr_dict["dynamic_prop"] = motion_status
                self.obj18_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["65"] = 1
                    
            # 目标物20 A
            if msg.arbitration_id == 0x542:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Distance_X = temp_msg["SEN_Obj_20_Distance_X"] + 5.3
                SEN_Obj_Distance_Y = temp_msg["SEN_Obj_20_Distance_Y"]
                SEN_Obj_Velocity_X = temp_msg["SEN_Obj_20_Velocity_X"]
                SEN_Obj_Velocity_Y = temp_msg["SEN_Obj_20_Velocity_Y"]
                SEN_Obj_Motion_Category_C = self.__oncomming_confirmation(temp_msg["SEN_Obj_20_Motion_Category_C"])
                SEN_Obj_Acceleration_X = temp_msg["SEN_Obj_20_Acceleration_X"] # new
                self.obj19_attr_dict["acceleration_long"] = SEN_Obj_Acceleration_X # new
                self.obj19_attr_dict["dist_long"] = SEN_Obj_Distance_X
                self.obj19_attr_dict["dist_lat"] = SEN_Obj_Distance_Y
                self.obj19_attr_dict["vrel_long"] = SEN_Obj_Velocity_X
                self.obj19_attr_dict["vrel_lat"] = SEN_Obj_Velocity_Y
                self.obj19_attr_dict["oncoming"] = SEN_Obj_Motion_Category_C
                self.obj19_attr_dict["following_mode"] = 0 # 融合没有输出此字段，先给个默认值
                self.fusion_msg_confirm__series["66"] = 1
            
            # 目标物20 B
            if msg.arbitration_id == 0x543:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_BoxSize_X = temp_msg["SEN_Obj_20_BoxSize_X"]
                SEN_Obj_BoxSize_Y = temp_msg["SEN_Obj_20_BoxSize_Y"]
                SEN_Obj_BoxAngle = temp_msg["SEN_Obj_20_BoxAngle"] / 180 * math.pi    
                SEN_Obj_Confidence = self.__obj_confidence_transition(temp_msg["SEN_Obj_20_Confidence"])
                self.obj19_attr_dict["length"] = SEN_Obj_BoxSize_X
                self.obj19_attr_dict["width"] = SEN_Obj_BoxSize_Y
                self.obj19_attr_dict["orientation_angle"] = SEN_Obj_BoxAngle
                self.obj19_attr_dict["prob_of_obj"] = SEN_Obj_Confidence
                self.obj19_attr_dict["identification"] = 1 if SEN_Obj_Confidence else 0
                self.fusion_msg_confirm__series["67"] = 1
                
            # 目标物20 C
            if msg.arbitration_id == 0x544:
                temp_msg = self.blf_parser.msg_parser(msg)
                SEN_Obj_Class = temp_msg["SEN_Obj_20_Class"]
                SEN_Obj_Veh_Subtype_C = temp_msg["SEN_Obj_20_Veh_Subtype_C"]
                SEN_Obj_Motion_Status = temp_msg["SEN_Obj_20_Motion_Status"]
                SEN_Obj_ID_Camera = temp_msg["SEN_Obj_20_ID_Camera"]
                obj_type = self.__obj_class_transition(SEN_Obj_Class,SEN_Obj_Veh_Subtype_C)
                motion_status = self.__obj_motion_status_transition(SEN_Obj_Motion_Status)
                SEN_Obj_Blinker_Info_C = temp_msg["SEN_Obj_20_Blinker_Info_C"]
                SEN_Obj_Brake_Lights_C = temp_msg["SEN_Obj_20_Brake_Lights_C"]
                self.obj19_attr_dict["blinker_info"] = SEN_Obj_Blinker_Info_C
                self.obj19_attr_dict["brake_lights"] = SEN_Obj_Brake_Lights_C
                self.obj19_attr_dict["obj_class"] = obj_type
                self.obj19_attr_dict["dynamic_prop"] = motion_status
                self.obj19_attr_dict["id"] = SEN_Obj_ID_Camera
                self.fusion_msg_confirm__series["68"] = 1
        self.__clean_up()
        
    def __clean_up(self):
        self.tcp_cilent.socket_close()
        print("All scene data has been played,bye")
        
    def __oncomming_confirmation(self,motion_category):
        """
        0=INVALID
        1=UNDEFINED
        2=PASSING
        3=PASSING_IN
        4=PASSING_OUT
        5=CLOSE_CUT_IN
        6=MOVING_IN
        7=MOVING_OUT
        8=CROSSING
        9=LTAP
        10=RTAP
        11=MOVING
        12=PRECEEDING
        13=ONCOMING
        """       
        temp_res = 0
        if motion_category == 13:
            temp_res = 1
        return temp_res    
    
    def __obj_confidence_transition(self,confidence):
        """
        融合对于confidence的定义：
        0~20 20为目标新建之后跟踪连续5帧以上	目标生存指数，赋予初值，随着跟踪状态产生加，减  初始值10，最大值20 最小值0 每帧进行更新
        但是座舱对于confidence的要求是0~100，先乘以5，后期发现不合适再调整
        """
        temp_confidence = confidence * 5 
        return temp_confidence
    
    def __obj_class_transition(self,type,subtype):
        """
        TODO: 确认静态障碍物如锥桶是否对应类型4
        融合信号定义:
            type:
                0=INVALID
                1=VEHICLE
                2=PEDESTRIAN
                3=CYCLIST
                4=GENERAL_OBJECT(reserved)
            subtype：
                0=Unknown
                1=Bus
                2=Small_Medium_Car
                3=Trucks
                4=Motors(Tri-cycle)
                5=Special_vehicle
                6=Tiny_car
                7=Lorry
        json定义的类型
            0 小汽车
            1 客车
            2 卡车
            3 公交车
            4 SUV
            5 货车
            6 自行车
            7 两轮电动车/摩托车
            8 行人
            9 一般障碍物，模型取锥桶
            10 不确定
        """
        temp_type = 10
        if type == 2:
            temp_type = 8
        elif type == 3:
            temp_type = 6
        elif type == 1:
            if subtype == 1:
                temp_type = 3
            elif subtype == 3:
                temp_type = 2
            elif subtype == 2:
                temp_type = 0
            elif subtype == 4:
                temp_type = 7
            elif subtype == 7:
                temp_type = 5
        return temp_type
                
    def __obj_motion_status_transition(self,motion_status):
        """
        弃用，已经json字段已经更新与融合输出一致
        融合输出：
            0=INVALID
            1=UNKNOWN
            2=MOVING
            3=STATIONARY
            4=STOPPED
            5=MOVING SLOWLY
        json定义：
            0 运动的
            1 （一直）静止的
            2 （刚停车的）
            3 慢速移动的
            4 未知的
        """
        temp_status = 4
        if motion_status == 2:
            temp_status = 0
        elif motion_status == 5:
            temp_status = 3
        elif motion_status == 4:
            temp_status = 1
        elif motion_status == 3:
            temp_status = 2
        return temp_status

if __name__ == "__main__":
    print("start")
    config_path = r"E:\work\交接\ICDC_data_player\config\config.ini"#
    dbc_path = r"E:\work\交接\ICDC_data_player\dbc"
    blf_path = r"E:\work\交接\blf\HSCAN4_5_20240622130513.blf"
    
    icdc_demo = IcdcDataPlayer(blf_path,dbc_path,config_path)
    icdc_demo.data_replay()
